package com.fzdy.product.base;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;

import java.util.List;

@Data
@NoArgsConstructor
public class AjaxCallBack {

    private Integer total;
    private List rows;
    private String statusCode;
    private String message;

    public AjaxCallBack(Page page) {
        this.total = page.getTotalPages();
        this.rows = page.getContent();
    }

    public AjaxCallBack(String statusCode, String message) {
        this.statusCode = statusCode;
        this.message = message;
    }
}
